package com.sbtr.business.auth.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sbtr.business.auth.entity.Role;
import com.sbtr.common.PageDto;
import com.sbtr.open.auth.dto.RoleAuthDto;
import com.sbtr.open.auth.dto.RoleDto;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 角色表 服务类
 * </p>
 *

 */
public interface IRoleService extends IService<Role> {
    public RoleDto findById( Long id);

    public boolean deleteById(Long id);

    public PageDto<RoleDto> search( String roleName,
                                   Long currPage, Long pageSize);

    public RoleDto save(RoleDto dto);

    public boolean addAuth( Long roleId,  List<String> userIds);

    public boolean deleteAuth(Long roleId, List<String> userIds);

    public List<RoleAuthDto> getAuth(Long roleId);

    /**
     * 判断用户是否管理员
     * @param userId
     * @return
     */
    public boolean isAdmin(String userId);
}
